function verCode() {
	let img = document.getElementById("img");
	img.src = "/article/image?date=" + new Date();
}

function inputVerCode() {
	let $verCode = $("#verCode").val();
	console.log($verCode);
	$.ajax({
		url: "/article/verCode",
		type: "post",
		data: {
			verCode: $verCode
		},
		success: function(res) {
			var checkclass = "";
			$("#res").removeClass("icon-gou icon-cuowu");
			if (res == true) {
				this.checkclass = "icon-gou";
				$("#res").css("color", "green");
				$("#res").addClass(this.checkclass);
				$("#btn-login").removeAttr("disabled");
				$("#primaryCheckbox3").removeAttr("disabled");
				let checked = $("#primaryCheckbox3").is(":checked");
				if (checked) {
					$("#btn-sign").removeClass("disabled");
				} else {
					$("#btn-sign").addClass("disabled");
				}
			} else {
				this.checkclass = "icon-cuowu";
				let img = document.getElementById("img");
				img.src = "/article/image?date=" + new Date();
				$("#res").css("color", "red");
				$("#res").addClass(this.checkclass);
				$("#btn-sign").addClass("disabled");
				$("#btn-login").attr("disabled", "disabled");
				$("#primaryCheckbox3").attr("disabled", "disabled");
			}
		}
	})
}

function check() {
	let checked = $("#primaryCheckbox3").is(":checked");
	if (checked) {
		$("#btn-sign").removeClass("disabled");
	} else {
		$("#btn-sign").addClass("disabled");
	}
}
